<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
		<title>讨论章节回复列表页</title>
		<link rel="stylesheet" href="../../css/mui.min.css" />
		<link rel="stylesheet" href="../../css/timecontrol.min.css" />
		<!--<link rel="stylesheet" href="../../css/CFNetPP_Base.css">-->
		<link rel="stylesheet" href="../../css/base.css"/>
		<link rel="stylesheet" type="text/css" href="../../css/weui.min.css">
		<link rel="stylesheet" type="text/css" href="../../css/study.css" />
		<script type="text/javascript" charset="utf-8"></script>
	</head>
	<body id="main" >
		<div class="base_style_color " id='BarAppearance' style="height: 22px;width: 100%"></div>
		<div class="base_navigation_bar base_style_color base_navigation_item_bar">
			<a class="base_left_item" href="#" onclick="backClick()"> <img class="base_back_icon" src="../../image/icon_jiantou.png" alt=""> </a>
			<span id="title"></span>
			<a class="base_right_item " href="#" onclick="ReplayDiscus()">回复 </a>
		</div>
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script src="../../script/mui.min.js"></script>
	<script src="../../script/common.js"></script>
	<script src="../../script/jquery.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script type="text/javascript">
		var id = '';
		var img = '';
		var pid = "";
		// 计划id
		var cid = "";
		//课程id
		var chapterid = "";
		//章节id
		apiready = function() {
			if (api.pageParam.type == 0) {//自由课程
				sendBuriedNotifi('0', '自由课程讨论回复列表页', '042');
			} else {
				sendBuriedNotifi('0', 'MOOC课程讨论章节回复列表', '154');
			}
			var pageParam = api.pageParam;
			pid = pageParam.pid;
			cid = pageParam.cid;
			chapterid = pageParam.chapterid;
			$('#title').text(api.pageParam.title);
			addframe();
			ReceivePopNotifi();
			//接收弹出通知
		};
		function sendBuriedNotifi(busionessid, pagetype, pagetypeid) {
			var userinfo = {
				uid : $api.getStorage('cfnetppuid'),
				jid : $api.getStorage('cfnetppjxid'),
				uname : $api.getStorage('cfnetppusername'),
				cid : api.pageParam.cid,
				pid : api.pageParam.pid,
				vid : api.pageParam.chapterid
			}
			var data = {
				busionessid : busionessid,
				pagetype : pagetype,
				pagetypeid : pagetypeid,
				sourceurl : api.pageParam.sourceurl,
				sourcetitle : api.pageParam.sourcetitle,
				accesspageurl : window.location.pathname,
				accesspagetitle : document.title,
				userinfo : userinfo
			}
			SendBehaviorTrajectoriesNotifi_Study(data);
		}

		function backClick() {
			if (api.pageParam.type == 0) {//自由课程
				sendBuriedNotifi('1', '自由课程讨论回复列表页', '042');
			} else {
				sendBuriedNotifi('1', 'MOOC课程讨论章节回复列表', '154');
			}
			api.closeWin({
			});
		}

		function ReceivePopNotifi() {
			//			api.addEventListener({
			//				name : 'PopNotifi'
			//			}, function(ret, err) {
			//				$('#offlineAlert').show();
			//				hideSubFrame();
			//			});
			api.addEventListener({
				name : 'keyback'
			}, function(ret, err) {
				backClick();
			});
		}

		function cleanCancel() {
			$('#offlineAlert').hide();
			showSubFrame();
		}

		//确定
		function cleanConfirm() {
			$('#offlineAlert').hide();
			showSubFrame();
		}

		function addframe() {
			var y = $('.base_navigation_bar').height() + 22;
			var h = api.winHeight - y;
			api.openFrame({
				name : 'New_Student_Study_DiscussChapterReplayFrame',
				url : 'New_Student_Study_DiscussChapterReplayFrame.html',
				rect : {
					x : 0,
					y : y,
					w : 'auto',
					h : h
				},
				pageParam : {
					data : api.pageParam.data,
					title : api.pageParam.title,
					pid : pid,
					cid : cid,
					type : api.pageParam.type,
					chapterid : chapterid,
				},
				bounces : false,
				vScrollBarEnabled : true,
				hScrollBarEnabled : false
			});
		}

		//回复讨论
		function ReplayDiscus() {
			api.openFrame({
				name : 'New_Study_ReplayDiscus',
				url : 'New_Study_ReplayDiscus.html',
				pageParam : {
				    username:api.pageParam.data.username,
					id : api.pageParam.data.id,
					pid : pid,
					cid : cid,
					chapterid : chapterid,
					title : api.pageParam.title,
					type : api.pageParam.type
				}
				//
			});
		}
	</script>
</html>